﻿using Rbac.Domain;
using Rbac.Project.Application.Admins.Dto;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Rbac.Project.Application.Admins
{
    public interface IAdminService
    {
        Task<ResultDto<Admin>> InsertAsync(CreateOrUpdateDto dto);
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<LoginResultDto> LoginAsync(LoginDto dto);
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        Task<PageDto<List<Admin>>> PageDataAsync(int PageIndex = 1, int PageSize = 10);
        /// <summary>
        /// Tuple分页
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        Task<ResultDto<Tuple<int, List<ListDto>>>> PageDataTupleAsync(QueryDto query, int PageIndex = 1, int PageSize = 10);
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        Task<ResultDto<(int, List<Admin>)>> PagerAsync(int PageIndex = 1, int PageSize = 10);
        /// <summary>
        /// 查找单个用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultDto<CreateOrUpdateDto>> FindAsync(int id);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultDto<bool>> DeleteAsync(int id);
    }
}